
const userSelection = {
  namespaced: true,
  state: {
    techField: '',
    position: '',
    languages: []
  },
  mutations: {
    SET_TECH_FIELD(state, payload) {
      state.techField = payload;
    },
    SET_POSITION(state, payload) {
      state.position = payload;
    },
    SET_LANGUAGES(state, payload) {
      state.languages = payload;
    }
  },
  actions: {
    updateTechField({ commit }, field) {
      commit('SET_TECH_FIELD', field);
    },
    updatePosition({ commit }, position) {
      commit('SET_POSITION', position);
    },
    updateLanguages({ commit }, languages) {
      commit('SET_LANGUAGES', languages);
    }
  },
  getters: {
    getTechField: (state) => state.techField,
    getPosition: (state) => state.position,
    getLanguages: (state) => state.languages
  }
};

export default userSelection;
